# 测试线程池的任务
import threading
from concurrent.futures import ThreadPoolExecutor
import time 


pool = ThreadPoolExecutor(2)  # 创建2个线程池
LOCK = threading.RLock()
A  = [(1, 2, 3, 4, 5), (5, 6, 7, 8, 9, 10), (5, 6, 7, 8, 9, 10),
      (5, 6, 7, 8, 9, 10), (5, 6, 7, 8, 9, 10), (5, 6, 7, 8, 9, 10)]

B = [(1, 2, 3, 4, 5), (1, 2, 3, 4, 5), (1, 2, 3, 4, 5), (1, 2, 3, 4, 5),
     (1, 2, 3, 4, 5), (1, 2, 3, 4, 5), (1, 2, 3, 4, 5), (1, 2, 3, 4, 5)]
total = 0


# 创建任务 来进行累加
def task(tup):
    global total 
    # LOCK.acquire()
    total += sum(tup)
    # LOCK.release()
    return total


for j in B:
    pool.submit(task, j)

time.sleep(1)

# 打印结果
print(total)

# 测试结果
addC = 0
for m in B:
    addC += sum(m)
print(addC)
